<?php
/**
 * 微博后台管理项目 媒体表数据层
 */

define("CACHE_TUIJIAN_UNLIKE","tuijian_unlike_");
class db_tuijian_unlike extends db_base
{
	var $table_name  ="tuijian_unlike";
	
	function get_list_by_uid($uid)
	{
		if(!$uid)
		{
			return false;
		}
		$key = CACHE_TUIJIAN_UNLIKE . "-get_list_by_uid-{$uid}";
		$mc = mem_cache::get_instance();
		$cache = $mc->get($key);
		if ($cache === false)
		{
			$where = " uid = $uid  ";
			$content = $this->get_alllist($this->table_name,"","", "", $where,"","unlike_uid");
			$mc->set($key, serialize($content), 0, CACHE_EXPIRE_MIN_10);
		}
		else
		{
			$content = unserialize($cache);
		}

		return $content;
	}
	
	
	

	function insert_tuijian_unlike($uid,$unlike_uid)
	{
		$ary["uid"] = $uid;
		$ary["unlike_uid"] = $unlike_uid;
		
		$res = $this->insert($this->table_name,$ary,"",true);
		
		$mc = mem_cache::get_instance();
		$key = CACHE_TUIJIAN_UNLIKE . "-get_list_by_uid-{$uid}";
		$mc->delete($key);
		
		return $res;
		
	}
	
}
